package activity;

import android.app.Activity;
import android.app.Application;
import android.content.SharedPreferences;
import utils.Config;

/**
 * Created by Shaxj on 2015/5/20.
 */
public class MyApplication extends Application {
    private static MyApplication instance = null;
    public SharedPreferences.Editor edit;
    public SharedPreferences sharedPreferences;

    public static MyApplication getInstance() {
        if (instance == null) {
            synchronized (MyApplication.class) {
                if (instance == null)
                    instance = new MyApplication();
            }
        }
        return instance;
    }

    @Override
    public void onCreate() {
        instance = this;
        super.onCreate();
        sharedPreferences = getSharedPreferences(Config.APP_NAME, Activity.MODE_PRIVATE);
        edit = sharedPreferences.edit();
    }

}
